package com.mmall.service.Impl;

import com.mmall.common.ServerResponse;
import com.mmall.dao.MessageMapper;
import com.mmall.pojo.Message;
import com.mmall.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("MessageService")
@Transactional
public class MessageServiceImpl implements MessageService{
    @Autowired
    private MessageMapper messageMapper;


    @Override
    public ServerResponse create(Message message){
        if(messageMapper.insert(message)>0){
            return ServerResponse.cerateBySuccessMessage("回复成功");
        }
        return ServerResponse.createByErrorMessage("留言失败");
    }
}
